/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
header {
    background-color: #4a6fa5;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    margin-bottom: 20px;
    font-size: 2rem;
}

#task-form {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#task-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    padding: 10px 20px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #1a252f;
}

/* 任务列表样式 */
.task-list {
    padding: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #4a6fa5;
    transition: transform 0.2s;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
    border-left-color: #28a745;
    opacity: 0.7;
}

.task-text {
    flex: 1;
    margin: 0 15px;
    word-break: break-word;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #6c757d;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.delete-btn {
    background-color: #dc3545;
    padding: 5px 10px;
    font-size: 0.9rem;
}

.delete-btn:hover {
    background-color: #bd2130;
}

/* 底部样式 */
footer {
    padding: 15px 20px;
    background-color: #e9ecef;
    text-align: center;
    font-weight: bold;
    color: #495057;
}

/* 响应式设计 */
@media (max-width: 600px) {
    #task-form {
        flex-direction: column;
    }
    
    #task-input {
        max-width: none;
        margin-bottom: 10px;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-text {
        margin: 10px 0;
    }
    
    .task-actions {
        align-self: flex-end;
    }
}